<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
    <meta name="generator" content="AsciiDoc 8.2.5" />
    <link rel="stylesheet" href="xhtml11.css" type="text/css" />
    <link rel="icon" href="chrome://vimperator/skin/icon.png" type="image/png" />
    <script type="application/x-javascript;version=1.8" src="help.js"></script>
    <title>map.html</title>
  </head>
<body>
<h1 style="font-size: inherit; text-align: right;">
  <span class="tag" style="float: none;">map.html</span>
</h1>
<div class="para"><p><div style="float: right; padding-left: 1px;"> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <fieldset class="paypal"> <input type="hidden" name="cmd" value="_s-xclick"/> <input type="image" src="" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"/> <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----"/> </fieldset> </form> </div> <span class="vimperator-logo"></span></p></div>
<div class="para"><p>Key mappings, abbreviations, and user-defined commands.</p></div>
<div class="para"><p><table style="border-bottom: 1px solid silver; width: 100%">
<tr style="width: 100%"><td style="width: 50%"><h2>Key&#160;mapping</h2></td><td style="width: 50%">
 <a id="macro"/><span class="tag">macro</span>
 <a id="mapping"/><span class="tag">mapping</span>
 <a id="key-mapping"/><span class="tag">key-mapping</span>
</td></tr>
</table></p></div>
<div class="para"><p>The key mapping commands can be used to either redefine the standard key
bindings or define new ones. A mapping consists of a key, or sequence of keys,
which are translated to a string of characters. Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>:map &lt;F2&gt; :echo new Date().toDateString()&lt;CR&gt;</tt></pre>
</div></div>
<div class="para"><p>will echo the current date to the command line when <a class="mapping" href="#">&lt;F2&gt;</a> is pressed.</p></div>
<div class="para"><p>There are separate key mapping tables for each of the Normal, Insert, and
Command-line modes.</p></div>
<div class="para"><p><span class="tag">:map-special-chars</span><br /></p></div>
<div class="para"><p><span class="tag">&lt;Nop&gt;</span><br />
<div class="key">&lt;Nop&gt;</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Do nothing. This command is useful for disabling a specific mapping. <a class="command" href="">:map
&lt;C-n&gt; &lt;Nop&gt;</a> will prevent <a class="mapping" href="">&lt;C-n&gt;</a> from doing anything.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">&lt;CR&gt;</span> <span class="tag">map_return</span><br />
<div class="key">&lt;CR&gt;</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Expand to a line terminator in a key mapping. An Ex command in the <span class="argument">&#123;rhs&#125;</span> of a
mapping requires a line terminator after it so that it is executed when the
mapping is expanded. <a class="mapping" href="#">&lt;CR&gt;</a> should be used for this purpose.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">&lt;Leader&gt;</span> <span class="tag">mapleader</span><br />
<div class="key">&lt;Leader&gt;</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Expands to the value of the "mapleader" variable in key mapping. If
"mapleader" is unset or empty then "\" is used. Example:<br />
&#160;<a class="command" href="">:map &lt;Leader&gt;h :echo "Hello"&lt;CR&gt;</a><br />
works like<br />
&#160;<a class="command" href="">:map \h :echo "Hello"&lt;CR&gt;</a><br />
but after<br />
&#160;<a class="command" href="">let mapleader = ","</a><br />
it works like<br />
&#160;<a class="command" href="">:map ,h :echo "Hello"&lt;CR&gt;</a></p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:map</span>
<div class="key">:map <span class="argument">&#123;lhs&#125;</span> <span class="argument">&#123;rhs&#125;</span></div><br />
<div class="key">:map <span class="argument">&#123;lhs&#125;</span></div><br />
<div class="key">:map</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Map the key sequence <span class="argument">&#123;lhs&#125;</span> to <span class="argument">&#123;rhs&#125;</span>. The <span class="argument">&#123;rhs&#125;</span> is remapped, allowing for
nested and recursive mappings.</p></div>
<div class="para"><p><span class="warning">Warning:</span> Mappings are NOT saved between sessions, make sure you put them in your
vimperatorrc file!</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:cm</span> <span class="tag">:cmap</span>
<div class="key">:cmap <span class="argument">&#123;lhs&#125;</span> <span class="argument">&#123;rhs&#125;</span></div><br />
<div class="key">:cmap <span class="argument">&#123;lhs&#125;</span></div><br />
<div class="key">:cmap</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Map the key sequence <span class="argument">&#123;lhs&#125;</span> to <span class="argument">&#123;rhs&#125;</span> (in Command-line mode). The <span class="argument">&#123;rhs&#125;</span> is
remapped, allowing for nested and recursive mappings.</p></div>
<div class="para"><p><span class="warning">Warning:</span> Mappings are NOT saved between sessions, make sure you put them in your
vimperatorrc file!</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:im</span> <span class="tag">:imap</span>
<div class="key">:imap <span class="argument">&#123;lhs&#125;</span> <span class="argument">&#123;rhs&#125;</span></div><br />
<div class="key">:imap <span class="argument">&#123;lhs&#125;</span></div><br />
<div class="key">:imap</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Map the key sequence <span class="argument">&#123;lhs&#125;</span> to <span class="argument">&#123;rhs&#125;</span> (in Insert mode). The <span class="argument">&#123;rhs&#125;</span> is remapped,
allowing for nested and recursive mappings.</p></div>
<div class="para"><p><span class="warning">Warning:</span> Mappings are NOT saved between sessions, make sure you put them in your
vimperatorrc file!</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:mapc</span> <span class="tag">:mapclear</span><br />
<div class="key">:mapc[lear]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove all mappings. All user-defined mappings which were set by <a class="command" href="">:map</a> or
<a class="command" href="">:noremap</a> are cleared.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:cmapc</span> <span class="tag">:cmapclear</span><br />
<div class="key">:cmapc[lear]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove all mappings (in Command-line mode). All user-defined mappings which
were set by <a class="command" href="">:cmap</a> or <a class="command" href="">:cnoremap</a> are cleared.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:imapc</span> <span class="tag">:imapclear</span><br />
<div class="key">:imapc[lear]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove all mappings (in Insert mode). All user-defined mappings which were set
by <a class="command" href="">:imap</a> or <a class="command" href="">:inoremap</a> are cleared.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:no</span> <span class="tag">:noremap</span><br />
<div class="key">:no[remap] <span class="argument">&#123;lhs&#125;</span> <span class="argument">&#123;rhs&#125;</span></div><br />
<div class="key">:no[remap] <span class="argument">&#123;lhs&#125;</span></div><br />
<div class="key">:no[remap]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Map the key sequence <span class="argument">&#123;lhs&#125;</span> to <span class="argument">&#123;rhs&#125;</span>. No remapping of the <span class="argument">&#123;rhs&#125;</span> is performed.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:cno</span> <span class="tag">:cnoremap</span><br />
<div class="key">:cno[remap] <span class="argument">&#123;lhs&#125;</span> <span class="argument">&#123;rhs&#125;</span></div><br />
<div class="key">:cno[remap] <span class="argument">&#123;lhs&#125;</span></div><br />
<div class="key">:cno[remap]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Map the key sequence <span class="argument">&#123;lhs&#125;</span> to <span class="argument">&#123;rhs&#125;</span> (in Command-line mode). No remapping of
the <span class="argument">&#123;rhs&#125;</span> is performed.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:ino</span> <span class="tag">:inoremap</span><br />
<div class="key">:ino[remap] <span class="argument">&#123;lhs&#125;</span> <span class="argument">&#123;rhs&#125;</span></div><br />
<div class="key">:ino[remap] <span class="argument">&#123;lhs&#125;</span></div><br />
<div class="key">:ino[remap]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Map the key sequence <span class="argument">&#123;lhs&#125;</span> to <span class="argument">&#123;rhs&#125;</span> (in Insert mode). No remapping of the
<span class="argument">&#123;rhs&#125;</span> is performed.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:map-&lt;silent&gt;</span><br /></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>When the first argument to one of the mapping commands is &lt;silent&gt;,
<span class="argument">&#123;rhs&#125;</span> is not echoed to the command line, nor, for that matter, anything
else until the command has completed.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:unm</span> <span class="tag">:unmap</span><br />
<div class="key">:unm[ap] <span class="argument">&#123;lhs&#125;</span></div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove the mapping of <span class="argument">&#123;lhs&#125;</span>.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:cunm</span> <span class="tag">:cunmap</span><br />
<div class="key">:cunm[ap] <span class="argument">&#123;lhs&#125;</span></div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove the mapping of <span class="argument">&#123;lhs&#125;</span> (in Command-line mode).</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:iunm</span> <span class="tag">:iunmap</span><br />
<div class="key">:iunm[ap] <span class="argument">&#123;lhs&#125;</span></div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove the mapping of <span class="argument">&#123;lhs&#125;</span> (in Insert mode).</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><table style="border-bottom: 1px solid silver; width: 100%">
<tr style="width: 100%"><td style="width: 50%"><h2>Abbreviations</h2></td><td style="width: 50%">


 <a id="abbreviations"/><span class="tag">abbreviations</span>
</td></tr>
</table></p></div>
<div class="para"><p>Vimperator can automatically replace words identified as abbreviations,
which may be used to save typing or to correct commonly misspelled
words. An abbreviation can be one of three types that are defined by the
types of constituent characters. Whitespace and quotes are non-keyword
types, and all other characters are keyword types.</p></div>
<div class="olist"><ol>
<li>
<p>
A "full-id" abbreviation consists entirely of keyword characters
(e.g., "teh", "msoft").
</p>
</li>
<li>
<p>
An "end-id" abbreviation ends in keyword character but otherwise
contains all non-keyword characters (e.g., "'i").
</p>
</li>
<li>
<p>
A "non-id" abbreviation ends in a non-keyword character but otherwise
contains any non-whitespace character (e.g., "def'").
</p>
</li>
</ol></div>
<div class="para"><p>Strings that cannot be abbreviations include "a'b" and "a b".</p></div>
<div class="para"><p>An abbreviation is recognized when a space, quote character, or
<a class="mapping" href="#">&lt;C-]&gt;</a> is typed after the abbreviation. There are no default
abbreviations, and abbreviations are never recursive.</p></div>
<div class="para"><p><span class="tag">:ab</span> <span class="tag">:abbreviate</span>
<div class="key">:ab[breviate] <span class="argument">&#123;lhs&#125;</span> <span class="argument">&#123;rhs&#125;</span></div><br />
<div class="key">:ab[breviate] <span class="argument">&#123;lhs&#125;</span></div><br />
<div class="key">:ab[breviate]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Abbreviate a key sequence. Abbreviate <span class="argument">&#123;lhs&#125;</span> to <span class="argument">&#123;rhs&#125;</span>. If only <span class="argument">&#123;lhs&#125;</span> is given,
list all abbreviations that start with <span class="argument">&#123;lhs&#125;</span>. If no arguments are given,
list all abbreviations.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:ca</span> <span class="tag">:cabbrev</span>
<div class="key">:ca[bbrev] <span class="argument">&#123;lhs&#125;</span> <span class="argument">&#123;rhs&#125;</span></div><br />
<div class="key">:ca[bbrev] <span class="argument">&#123;lhs&#125;</span></div><br />
<div class="key">:ca[bbrev]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Abbreviate a key sequence for Command-line mode. Same as <a class="command" href="#">:ab[reviate]</a>,
but for Command-line mode only.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:ia</span> <span class="tag">:iabbrev</span>
<div class="key">:ia[bbrev] <span class="argument">&#123;lhs&#125;</span> <span class="argument">&#123;rhs&#125;</span></div><br />
<div class="key">:ia[bbrev] <span class="argument">&#123;lhs&#125;</span></div><br />
<div class="key">:ia[bbrev]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Abbreviate a key sequence for Insert mode. Same as <a class="command" href="#">:ab[breviate]</a> but
for Insert mode only.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:una</span> <span class="tag">:unabbreviate</span>
<div class="key">:una[bbreviate] <span class="argument">&#123;lhs&#125;</span></div><br /></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove an abbreviation.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:cuna</span> <span class="tag">:cunabbrev</span>
<div class="key">:cuna[bbrev] <span class="argument">&#123;lhs&#125;</span></div><br /></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove an abbreviation for Command-line mode. Same as <a class="command" href="#">:una[bbreviate]</a>,
but for Command-line mode only.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:iuna</span> <span class="tag">:iunabbrev</span>
<div class="key">:iuna[bbrev] <span class="argument">&#123;lhs&#125;</span></div><br /></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove an abbreviation for Insert mode. Same as <a class="command" href="#">:una[bbreviate]</a> but for
Insert mode only.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:abc</span> <span class="tag">:abclear</span><br />
<div class="key">:abc[lear]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove all abbreviations.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:cabc</span> <span class="tag">:cabclear</span><br />
<div class="key">:cabc[lear]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove all abbreviations for Command-line mode.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:iabc</span> <span class="tag">:iabclear</span><br />
<div class="key">:iabc[lear]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Remove all abbreviations for Insert mode.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><table style="border-bottom: 1px solid silver; width: 100%">
<tr style="width: 100%"><td style="width: 50%"><h2>User-defined&#160;commands</h2></td><td style="width: 50%">


 <a id="user-commands"/><span class="tag">user-commands</span>
</td></tr>
</table></p></div>
<div class="para"><p><span class="tag">:com</span> <span class="tag">:command</span>
<div class="key">:com[mand]</div><br /></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>List all user-defined commands.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><div class="key">:com[mand] <span class="argument">&#123;cmd&#125;</span></div><br /></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>List all user-defined commands that start with <span class="argument">&#123;cmd&#125;</span>.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><div class="key">:com[mand]<span class="argument">&#91;!&#93;</span> [<span class="argument">&#123;attr&#125;</span>&#8230;] <span class="argument">&#123;cmd&#125;</span> <span class="argument">&#123;rep&#125;</span></div><br /></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Define a new user command. The name of the command is <span class="argument">&#123;cmd&#125;</span> and its replacement
text is <span class="argument">&#123;rep&#125;</span>. The command's attributes are <span class="argument">&#123;attr&#125;</span>. If a command with this name
already exists an error is reported unless <span class="argument">&#91;!&#93;</span> is specified, in which case the
command is redefined. Unlike Vim, the command may start with a lowercase
letter.</p></div>
<div class="para"><p>The command's behavior can be specified by providing attributes when the
command is defined.</p></div>
<div class="para"><p><span class="tag">E175</span> <span class="tag">E176</span> <span class="tag">:command-nargs</span><br />
Argument handling</p></div>
<div class="para"><p>By default user commands accept no arguments. This can be changed by specifying
the -nargs attribute.</p></div>
<div class="para"><p>The valid values are:</p></div>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="125" />
<col width="788" />
<tbody valign="top">
  <tr>
    <td align="left">
    <strong>-nargs=0</strong>
    </td>
    <td align="left">
    No arguments are allowed (default)
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>-nargs=1</strong>
    </td>
    <td align="left">
    One argument is allowed
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>-nargs=</strong>*
    </td>
    <td align="left">
    Zero or more arguments are allowed
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>-nargs=?</strong>
    </td>
    <td align="left">
    Zero or one argument is allowed
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>-nargs=+</strong>
    </td>
    <td align="left">
    One or more arguments are allowed
    </td>
  </tr>
</tbody>
</table>
</div>
<div class="para"><p><span class="tag">E180</span> <span class="tag">E181</span> <span class="tag">:command-complete</span><br />
Argument completion</p></div>
<div class="para"><p>Completion for arguments to user defined commands is not available by default.
Completion can be enabled by specifying one of the following arguments to the
-complete option when defining the command.</p></div>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="194" />
<col width="720" />
<tbody valign="top">
  <tr>
    <td align="left">
    <strong>altstyle</strong>
    </td>
    <td align="left">
    alternate author style sheets
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>bookmark</strong>
    </td>
    <td align="left">
    bookmarks
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>buffer</strong>
    </td>
    <td align="left">
    buffers
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>color</strong>
    </td>
    <td align="left">
    color schemes
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>command</strong>
    </td>
    <td align="left">
    Ex commands
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>dialog</strong>
    </td>
    <td align="left">
    Firefox dialogs
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>dir</strong>
    </td>
    <td align="left">
    directories
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>environment</strong>
    </td>
    <td align="left">
    environment variables
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>event</strong>
    </td>
    <td align="left">
    autocommand events
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>file</strong>
    </td>
    <td align="left">
    files
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>help</strong>
    </td>
    <td align="left">
    help tags
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>highlight</strong>
    </td>
    <td align="left">
    highlight groups
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>javascript</strong>
    </td>
    <td align="left">
    JavaScript expressions
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>macro</strong>
    </td>
    <td align="left">
    named macros
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>mapping</strong>
    </td>
    <td align="left">
    user mappings
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>menu</strong>
    </td>
    <td align="left">
    menu items
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>option</strong>
    </td>
    <td align="left">
    Vimperator options
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>preference</strong>
    </td>
    <td align="left">
    Firefox preferences
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>search</strong>
    </td>
    <td align="left">
    search engines and keywords
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>shellcmd</strong>
    </td>
    <td align="left">
    shell commands
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>sidebar</strong>
    </td>
    <td align="left">
    sidebar panels
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>url</strong>
    </td>
    <td align="left">
    URLs
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>usercommand</strong>
    </td>
    <td align="left">
    user commands
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>custom,<span class="argument">&#123;func&#125;</span></strong>
    </td>
    <td align="left">
    custom completion, provided by <span class="argument">&#123;func&#125;</span>
    </td>
  </tr>
</tbody>
</table>
</div>
<div class="para"><p><span class="tag">E467</span> <span class="tag">E468</span> <span class="tag">:command-completion-custom</span><br />
Custom completion</p></div>
<div class="para"><p>Custom completion can be provided by specifying the "custom,<span class="argument">&#123;func&#125;</span>" argument to
-complete. The <span class="argument">&#123;func&#125;</span> is called with two arguments, a completion context, and
an object describing the command's arguments. It should set the context's
'completions' property, or return an object, with 'start' and 'items'
properties, describing the completions and where the replacement is to start.</p></div>
<div class="para"><p><strong>start</strong> is the index into the word being completed at which the returned values
should be applied and <strong>completions</strong> is a two dimensional array of the form:
[[arg1, description1], [arg2, description2], &#8230;]</p></div>
<div class="para"><p><span class="tag">E177</span> <span class="tag">E178</span> <span class="tag">:command-count</span><br />
Count handling</p></div>
<div class="para"><p>By default user commands do not accept a count. Use the -count attribute if
you'd like to have a count passed to your user command. This will then be
available for expansion as &lt;count&gt; in the argument.</p></div>
<div class="para"><p><span class="tag">:command-bang</span><br />
Special cases</p></div>
<div class="para"><p>By default a user command does not have a special version, i.e. a version
executed with the ! modifier. Providing the -bang attribute will enable this
and &lt;bang&gt; will be available in the argument.</p></div>
<div class="para"><p><span class="tag">:command-replacement-text</span><br />
Replacement text</p></div>
<div class="para"><p>The replacement text <span class="argument">&#123;rep&#125;</span> is scanned for escape sequences and these are
replaced with values from the user-entered command line. The resulting string
is then executed as an Ex command.</p></div>
<div class="para"><p>The valid escape sequences are:</p></div>
<div class="tableblock">
<table rules="none"
frame="hsides"
cellspacing="0" cellpadding="4">
<col width="125" />
<col width="788" />
<tbody valign="top">
  <tr>
    <td align="left">
    <strong>&lt;args&gt;</strong>
    </td>
    <td align="left">
    The command arguments exactly as supplied
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>&lt;count&gt;</strong>
    </td>
    <td align="left">
    Any supplied count, e.g. 5
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>&lt;bang&gt;</strong>
    </td>
    <td align="left">
    ! if the command was executed with the ! modifier
    </td>
  </tr>
  <tr>
    <td align="left">
    <strong>&lt;lt&gt;</strong>
    </td>
    <td align="left">
    A literal <a class="option" href="#">'&lt;'</a> character to allow for a literal copy of one of the escape sequences. E.g. &lt;lt&gt;args&gt; will expand to a literal &lt;args&gt;
    </td>
  </tr>
</tbody>
</table>
</div>
<div class="para"><p>"q-" can be prefixed to the escape sequence so that the value is quoted, making
it suitable for expression evaluation. Example: &lt;q-args&gt;</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:comc</span> <span class="tag">:comclear</span><br />
<div class="key">:comc[lear]</div></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Delete all user-defined commands.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><span class="tag">:delc</span> <span class="tag">:delcommand</span>
<div class="key">:delc[ommand] <span class="argument">&#123;cmd&#125;</span></div><br /></p></div>
<div class="quoteblock">
<div class="content">
<div class="para"><p>Delete the user-defined command <span class="argument">&#123;cmd&#125;</span>.</p></div>
<div class="attribution">
</div></div></div>
<div class="para"><p><table style="border-bottom: 1px solid silver; width: 100%">
<tr style="width: 100%"><td style="width: 50%"><h2>Examples</h2></td><td style="width: 50%">


 <a id="command-examples"/><span class="tag">command-examples</span>
</td></tr>
</table></p></div>
<div class="para"><p>Add a :Google command to search via google:</p></div>
<div class="literalblock">
<div class="content">
<pre><tt>:command -nargs=* Google open google &lt;args&gt;</tt></pre>
</div></div>
<div id="footer">
<div id="footer-text">
Last updated 2009-02-28 20:06:36 IST
</div>
</div>
</body>
</html>
